package n.d.l.svn.mapper.project;

import java.util.List;

import n.d.l.svn.bean.Project;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface ProjectMapper {

	@Insert("insert into project(name,svn_dir,local_dir,patch_dir,last_update_time,relative_url) values(#{name},#{svnDir},#{localDir},#{patchDir},now(),${relativeUrl})")
	int save(Project project);

	@Update("update project set name=#{name},svn_dir=#{svnDir},local_dir=#{localDir},patch_dir=#{patchDir},relative_url=#{relativeUrl} where id=#{id}")
	int update(Project project);

	List<Project> findList(Project project);
	
	Project getById(int id);

	@Update("update project set status=0 where id=#{id}")
	int delById(int id);

	@Update("update project set ignores=#{ignores}, last_update_time=#{lastUpdateTime} where id=#{id}")
	int updateIgnore(Project project);
}
